define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'article.cate/index',
        add_url: 'article.cate/add',
        edit_url: 'article.cate/edit',
        delete_url: 'article.cate/delete',
        export_url: 'article.cate/export',
        modify_url: 'article.cate/modify',

    };

    return {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id',search: false, title: 'id'},
                    {field: 'title', title: '分类名'},
                    {field: 'sort',search: false, title: '排序', edit: 'text'},
                    {field: 'status',title:'状态', search: 'select', selectList: {0: '禁用', 1: '启用'},templet: ea.table.switch},
                    {field: 'create_time', search: false, title: '创建时间'},
                    {width: 250, title: '操作', templet: ea.table.tool},

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
});